//
// Created by 123 on 2025/1/8.
//
#include "iostream"
#include "deque"
#include "algorithm"
using namespace std;

void printDeque(deque<int>& d){
    for(deque<int>::const_iterator it=d.begin();it!=d.end();it++){
        cout << *it << " ";
    }
    cout << endl;
}

void test(){
    deque<int> d;
    d.push_back(4);
    d.push_back(1);
    d.push_back(2);
    d.push_back(3);
    d.push_front(0);

    for (int i = 0; i < d.size(); ++i) {
        cout << d[i] << endl;
        cout << d.at(i) << endl;
    }
    cout << "d.forn()=  " << d.front() << endl;
    cout << "d.end()=  " << d.back() << endl;

    printDeque(d);
    sort(d.begin(),d.end());
    printDeque(d);

}

int main128(){
    test();
    return 0;
}


